//
//  SelectCarView.m
//  TCProject
//
//  Created by admin on 16/1/20.
//  Copyright © 2016年 wise-wing. All rights reserved.
//

#import "SelectCarView.h"

#import "CZSelectCarCell.h"

@interface SelectCarView () <UITableViewDelegate, UITableViewDataSource>

@end

@implementation SelectCarView

- (void)awakeFromNib
{
    self.layer.cornerRadius = 5.f;
    self.layer.masksToBounds = YES;
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [self.tableView registerNib:[UINib nibWithNibName:@"CZSelectCarCell" bundle:nil] forCellReuseIdentifier:reuseIdentifier];
    self.tableView.tableFooterView = [UIView new];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _cars.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CZSelectCarCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    cell.car = _cars[indexPath.row];
    return cell;
}

- (void)setCars:(NSArray *)cars
{
    _cars = cars;
    [self.tableView reloadData];
}


@end